package cn.itcast.test;

import java.util.*;

public class App {
    public static void main(String[] args) {
        Integer[] num = new Integer[]{1, 2, 3};

        List<Integer> list = asList(num);

        System.out.println("list = " + list);
    }

    public static <T> List<T> asList(T... a) {
        List<T> list = new ArrayList<>();
        for (int i = 0; i < a.length; i++) {
            list.add(a[i]);
        }
        return list;
    }
}
